/**
 * pharma-model - 9 janv. 2011 guillaume
 */
package org.bspv.pharma.model.security;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Version;

import org.bspv.pharma.model.User;

/**
 * @author guillaume
 */
@Entity
@Table(name = "CREDENTIAL")
public class Credential implements Serializable {

    /**
     * serialVersionUID.
     */
    private static final long serialVersionUID = 2435851717114020867L;

    /**
     * Identifiant.
     */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    /**
     * utilisateur concerné.
     */
    @ManyToOne
    private User user;
    /**
     * Role.
     */
    @ManyToOne
    private Role role;
    /**
     * Date de début.
     */
    private Date begining;
    /**
     * Date de fin.
     */
    private Date end;
    /**
     * Numéro de version.
     */
    @Version
    private Integer version;

    /**
     * @return the id
     */
    public final Long getId() {
        return id;
    }

    /**
     * @param id
     *            the id to set
     */
    public final void setId(final Long id) {
        this.id = id;
    }

    /**
     * @return the user
     */
    public final User getUser() {
        return user;
    }

    /**
     * @param user
     *            the user to set
     */
    public final void setUser(final User user) {
        this.user = user;
    }

    /**
     * @return the role
     */
    public final Role getRole() {
        return role;
    }

    /**
     * @param role
     *            the role to set
     */
    public final void setRole(final Role role) {
        this.role = role;
    }

    /**
     * @return the begining
     */
    public final Date getBegining() {
        return begining;
    }

    /**
     * @param begining
     *            the begining to set
     */
    public final void setBegining(final Date begining) {
        this.begining = begining;
    }

    /**
     * @return the end
     */
    public final Date getEnd() {
        return end;
    }

    /**
     * @param end
     *            the end to set
     */
    public final void setEnd(final Date end) {
        this.end = end;
    }

    /**
     * @return the version
     */
    public final Integer getVersion() {
        return version;
    }

    /**
     * @param version
     *            the version to set
     */
    public final void setVersion(final Integer version) {
        this.version = version;
    }

}
